package com.bwie.controller;

import com.bwie.param.CouponCodeParam;
import com.bwie.service.TbCouponCodeService;
import com.bwie.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/user/coupon")
public class CouponController {
    @Autowired
    private TbCouponCodeService tbCouponCodeService;

    /**
     * 劵码列表
     * @param couponCodeParam
     * @return
     */
    @PostMapping("/getCouponList")
    public R getCouponList(@RequestBody CouponCodeParam couponCodeParam){
        return tbCouponCodeService.getCouponList(couponCodeParam);
    }
    /**
     * 劵码数量+1
     */
    @PostMapping("/toupdateNum/{couponCodeId}")
    public R toupdateNum(@PathVariable(name = "couponCodeId")Integer couponCodeId){
        return tbCouponCodeService.toupdateNum(couponCodeId);
    }
}
